package sdfi.lee.Entity;

import java.util.Date;

import sdfi.lee.DAO.DrugDAO;
import sdfi.lee.Entity.base.BaseDrug;



public class Drug extends BaseDrug {
	private static final long serialVersionUID = 1L;

/*[CONSTRUCTOR MARKER BEGIN]*/
	public Drug () {
		super();
	}
	public Drug(Integer id,String drugname,Date drugdate)
	{
		this.setDrugname(drugname);
		this.setId(id);
		this.setDrugdate(drugdate);
	}

	/**
	 * Constructor for primary key
	 */
	public Drug (java.lang.Integer id) {
		super(id);
	}
	public String execute()
	{	this.setDrugdate(new Date());
		return new DrugDAO().drugAdd(this);
	}
	public String modify()
	{
		try
		{
			
			return new DrugDAO().drugModify(this);
		}
		catch(Exception ee)
		{
			ee.printStackTrace();
			return "error";
		}
		
	}
	private String type;
/*[CONSTRUCTOR MARKER END]*/

	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}


}